package com.itheima.wms.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.base.entity.Entity;
import com.itheima.pinda.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 入库单
 * </p>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@SuperBuilder
@TableName("wms_receipt")
@ApiModel(value = "Receipt", description = "入库单")
public class ReceiptEntity extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 入库单号
     */
    @ApiModelProperty(value = "入库单号")
    @NotEmpty(message = "入库单号不能为空", groups = {Save.class})
    @Length(max = 50, message = "入库单号长度不能超过50")
    @TableField(value = "code")
    private String code;
    /**
     * 运单编号
     */
    @ApiModelProperty(value = "运单编号")
    @NotEmpty(message = "运单编号不能为空", groups = {Save.class})
    @Length(max = 50, message = "运单编号长度不能超过50")
    @TableField(value = "bill_code")
    private String billCode;
    /**
     * 计划到达时间
     */
    @ApiModelProperty(value = "计划到达时间")
    @NotNull(message = "计划到达时间不能为空", groups = {Save.class})
    @TableField(value = "plan_arrival_time")
    private java.time.LocalDateTime planArrivalTime;
    /**
     * 货主id
     */
    @ApiModelProperty(value = "货主id")
    @NotNull(message = "货主id不能为空", groups = {Save.class})
    @TableField(value = "owner_id")
    private Long ownerId;
    /**
     * 仓库id
     */
    @ApiModelProperty(value = "仓库id")
    @NotNull(message = "仓库id不能为空", groups = {Save.class})
    @TableField(value = "warehouse_id")
    private Long warehouseId;
    /**
     * 库区id
     */
    @ApiModelProperty(value = "库区id")
    @TableField(value = "area_id")
    private Long areaId;
    /**
     * 车牌号
     */
    @ApiModelProperty(value = "车牌号")
    @Length(max = 10, message = "车牌号长度不能超过10")
    @TableField(value = "license")
    private String license;
    /**
     * 发货人姓名
     */
    @ApiModelProperty(value = "发货人姓名")
    @NotEmpty(message = "发货人姓名不能为空", groups = {Save.class})
    @Length(max = 10, message = "发货人姓名长度不能超过10")
    @TableField(value = "shipper_name")
    private String shipperName;
    /**
     * 送货人姓名
     */
    @ApiModelProperty(value = "送货人姓名")
    @NotEmpty(message = "送货人姓名不能为空", groups = {Save.class})
    @Length(max = 10, message = "送货人姓名长度不能超过10")
    @TableField(value = "delivery_name")
    private String deliveryName;
    /**
     * 送货人电话
     */
    @ApiModelProperty(value = "送货人电话")
    @NotEmpty(message = "送货人电话不能为空", groups = {Save.class})
    @Length(max = 20, message = "送货人电话长度不能超过20")
    @TableField(value = "delivery_phone")
    private String deliveryPhone;
    /**
     * 预计到货数
     */
    @ApiModelProperty(value = "预计到货数")
    @TableField(value = "plan_num")
    private Integer planNum;
    /**
     * 承运商id
     */
    @ApiModelProperty(value = "承运商id")
//    @NotNull(message = "承运商id不能为空", groups = {Save.class})
    @TableField(value = "carrier_id")
    private Long carrierId;
    /**
     * 入库单状态 1新建、2收货中、3已取消、4收货完成、5上架中、6上架完成
     */
    @ApiModelProperty(value = "入库单状态 1新建、2收货中、3已取消、4收货完成、5上架中、6上架完成")
    @TableField(value = "status")
    private Integer status;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark")
    private String remark;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Length(max = 50, message = "创建人长度不能超过50")
    @TableField(value = "create_name", fill = FieldFill.INSERT)
    private String createName;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @Length(max = 50, message = "更新人长度不能超过50")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE)
    private String updateName;
    /**
     * 逻辑删除 0 删除
     */
    @ApiModelProperty(value = "逻辑删除 0 删除")
    @TableField(value = "logic_del")
    private Integer logicDel;
}
